package algo;

import java.io.IOException;
import java.io.ObjectInputStream.GetField;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;

import objects.Client;
import objects.Measurement;
import objects.ReferencePoint;

import dao.ReferencePointsDAO;

public class Main {

	/**
	 * @param args
	 * @throws SQLException 
	 * @throws IOException
	 */
	public static void main(String[] args) throws SQLException, IOException {
		
		//InitAps.addAps("C:\\Users\\Micka�l\\Desktop\\proj\\source\\wifi_geo_data\\ap.cfg");
		
		//InitMeasurements.addMeasurements("C:\\Users\\Micka�l\\Desktop\\proj\\source\\wifi_geo_data\\toutes.csv");


		Client client = new Client();
		client.setAntennaGain(5);


		ArrayList<ReferencePoint> referencePoints = ReferencePointsDAO.read();
		HashMap<String, Measurement> measurements = referencePoints.get(32).getMeasurements();
		HashMap<String, Measurement> measurements2 = referencePoints.get(5).getMeasurements();
		Object[] m = measurements.values().toArray();
		Object[] m2 = measurements2.values().toArray();
		client.setMeasurements(measurements);

		
		new AlgorythmManager().frbhm(client);

		System.out.println(client.getPosition().getX() + " " + client.getPosition().getY());
	}

}
